package com.kaiwukj.android.ufamily.mvp.http.api.service;

import com.kaiwukj.android.ufamily.mvp.http.entity.base.BaseListResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.base.BaseObjResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.AboutGoodsResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.ChatSearchGroupResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.ChatSearchPersonResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.CommentResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.DynamicReportTypeResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.DynamicResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.FansResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.FriendRecoResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.ShieldResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.TopicResult;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface DynamicService {

    @GET("/social/app/dynamicDetail/page")
    Observable<BaseListResp<DynamicResult>> fetchDynamic(//@Query("page") Integer page,
                                                         @Query("startId") Integer startId,
                                                         @Query("pageSize") Integer pageSize,
                                                         @Query("topicId") Integer topicId,
                                                         @Query("topicTitle") String topicTitle,
                                                         @Query("isHot") Integer isHot,
                                                         @Query("type") Integer type,
                                                         @Query("userId") Integer userId);

    @GET("/social/app/dynamicDetail/page")
    Observable<BaseListResp<DynamicResult>> fetchTopicDynamic(@Query("page") Integer page,
                                                              // @Query("startId") Integer startId,
                                                              @Query("pageSize") Integer pageSize,
                                                              @Query("topicId") Integer topicId,
                                                              @Query("topicTitle") String topicTitle,
                                                              @Query("isHot") Integer isHot,
                                                              @Query("type") Integer type,
                                                              @Query("userId") Integer userId);


    @GET("/social/app/dynamicDetail/pageConcern")
    Observable<BaseListResp<DynamicResult>> fetchAttentionDynamic(@Query("startId") int startId,
                                                                  @Query("pageSize") int pageSize,
                                                                  @Query("type") int type);

    @GET("/social/app/dynamicDetail/getDynamicDetail/{id}")
    Observable<BaseObjResp<DynamicResult>> getDynamicById(@Path("id") int id);

    @GET("/social/app/userConcern/listRecommendConcern")
    Observable<BaseObjResp<List<FriendRecoResult>>> fetchRecoAttention(@Query("type") int type);


    @GET("/social/app/dynamicComment/page")
    Observable<BaseListResp<CommentResult>> fetchComment(@Query("dynamicId") Integer dId,
                                                         @Query("startId") Integer startId,
                                                         @Query("pageSize") Integer pageSize);

    @GET("/social/app/dynamicCommentReply/page")
    Observable<BaseListResp<CommentResult>> fetchCommentByComment(@Query("replyId") Integer replyId,
                                                                  @Query("startId") Integer startId,
                                                                  @Query("pageSize") Integer pageSize);


    @POST("/social/app/dynamicComment/addDynamicComment")
    Observable<BaseObjResp<Integer>> comment(@Body RequestBody body);

    @POST("/social/app/dynamicCommentReply/addDynamicCommentReply")
    Observable<BaseObjResp<Integer>> commentReply(@Body RequestBody body);

    @POST("/social/app/dynamicComment/{id}")
    Observable<BaseObjResp<Void>> delComment(@Path("id") int id);

    @POST("/social/app/dynamicCommentReply/{id}")
    Observable<BaseObjResp<Void>> delCommentReply(@Path("id") int id);

    @POST("/social/app/userConcern/addUserConcern")
    Observable<BaseObjResp<Void>> attention(@Body RequestBody body);

    @POST("/social/app/userConcern/{id}")
    Observable<BaseObjResp<Void>> cancelAttention(@Path("id") int id);

    @POST("/social/app/userPraise/addUserPraise/{id}")
    Observable<BaseObjResp<Integer>> praise(@Path("id") int id);

    @POST("/social/app/userPraise/delUserPraise/{id}")
    Observable<BaseObjResp<Integer>> cancelPraise(@Path("id") int id);

    @POST("/social/app/userDynamicReport/addUserDynamicReport")
    Observable<BaseObjResp<Void>> report(@Body RequestBody body);

    @POST("/social/app/userShield/updateUserShield")
    Observable<BaseObjResp<Void>> shield(@Body RequestBody body);

    @POST("/social/app/dynamicDetail/addDynamicDetail")
    Observable<BaseObjResp<Integer>> publishDynamic(@Body RequestBody body);

    @POST("/social/app/dynamicDetail/{id}")
    Observable<BaseObjResp<Void>> deleteDynamic(@Path("id") int id);

    @GET("/social/app/topicDetail/page")
    Observable<BaseListResp<TopicResult>> fetchTopic(@Query("page") Integer page,
                                                     @Query("pageSize") Integer pageSize,
                                                     @Query("topicTitle") String keyword,
                                                     @Query("userId") Integer userId);

    @GET("/social/app/topicDetail/getTopicDetail/{id}")
    Observable<BaseObjResp<TopicResult>> getTopicById(@Path("id") Integer id);

    @POST("/social/app/topicDetail/addTopicDetail")
    Observable<BaseObjResp<Integer>> addTopic(@Body RequestBody body);

    @GET("/social/app/userConcern/pageBeConcernList")
    Observable<BaseListResp<FansResult>> fetchFansResult(@Query("id") Integer id,
                                                         @Query("startId") int startId,
                                                         @Query("pageSize") int pageSize);

    @GET("/social/app/userConcern/pageConcernList")
    Observable<BaseListResp<FansResult>> fetchAttentionResult(@Query("id") Integer id,
                                                              @Query("startId") int startId,
                                                              @Query("pageSize") int pageSize);

    @GET("/social/app/message/pageRelatedPraise")
    Observable<BaseListResp<AboutGoodsResult>> fetchAboutGoodsResult(@Query("page") int page,
                                                                     @Query("pageSize") int pageSize);

    @GET("/social/app/message/pageRelatedReply")
    Observable<BaseListResp<AboutGoodsResult>> fetchAboutCommentResult(@Query("page") int page,
                                                                       @Query("pageSize") int pageSize);

    @GET("/social/app/message/pageRelatedConcern")
    Observable<BaseListResp<AboutGoodsResult>> fetchAboutFansResult(@Query("page") int page,
                                                                    @Query("pageSize") int pageSize);

    @GET("/social/app/userDynamicReport/listReportType")
    Observable<BaseObjResp<List<DynamicReportTypeResult>>> fetchDynamicReportType();

    @GET("/social/app/message/searchUser")
    Observable<BaseObjResp<List<ChatSearchPersonResult>>> fetchSearchPersonResult(@Query("nickname") String keyword);

    @GET("/social/app/message/searchTopic")
    Observable<BaseObjResp<List<ChatSearchGroupResult>>> fetchSearchGroupResult(@Query("topic") String keyword);

    @GET("/social/app/userShield/page")
    Observable<BaseListResp<ShieldResult>> fetchShieldList(@Query("page") Integer page,
                                                           @Query("pageSize") Integer pageSize,
                                                           @Query("type") Integer type);

    @PUT("/social/app/topicDetail/joinGroupChat/{groupId}")
    Observable<BaseObjResp<String>> joinChatGroup(@Path("groupId") String groupId);


}
